package com.piece.module.spider.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@NoArgsConstructor
@Table(name = "sp_function")
@ApiModel(value = "爬虫函数表:sp_function")
public class Function {

    @Id
    @Column(name = "id", length = 11)
    @ApiModelProperty(value = "主键")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "name")
    @ApiModelProperty(value = "函数名")
    private String name;

    @Column(name = "parameter")
    @ApiModelProperty(value = "函数参数")
    private String parameter;

    @Column(name = "script")
    @ApiModelProperty(value = "函数脚本")
    private String script;

    @Column(name = "create_date")
    @ApiModelProperty(value = "创建日期")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createDate;
}
